/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'drds.ap-southeast-1.aliyuncs.com',
    ap-northeast-2-pop = 'drds.ap-southeast-1.aliyuncs.com',
    ap-south-1 = 'drds.ap-southeast-1.aliyuncs.com',
    ap-southeast-2 = 'drds.ap-southeast-1.aliyuncs.com',
    ap-southeast-3 = 'drds.ap-southeast-1.aliyuncs.com',
    ap-southeast-5 = 'drds.ap-southeast-1.aliyuncs.com',
    cn-beijing-finance-1 = 'drds.aliyuncs.com',
    cn-beijing-finance-pop = 'drds.aliyuncs.com',
    cn-beijing-gov-1 = 'drds.aliyuncs.com',
    cn-beijing-nu16-b01 = 'drds.aliyuncs.com',
    cn-chengdu = 'drds.aliyuncs.com',
    cn-edge-1 = 'drds.aliyuncs.com',
    cn-fujian = 'drds.aliyuncs.com',
    cn-haidian-cm12-c01 = 'drds.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'drds.aliyuncs.com',
    cn-hangzhou-finance = 'drds.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'drds.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'drds.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'drds.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'drds.aliyuncs.com',
    cn-hangzhou-test-306 = 'drds.aliyuncs.com',
    cn-hongkong-finance-pop = 'drds.aliyuncs.com',
    cn-qingdao-nebula = 'drds.aliyuncs.com',
    cn-shanghai-et15-b01 = 'drds.aliyuncs.com',
    cn-shanghai-et2-b01 = 'drds.aliyuncs.com',
    cn-shanghai-inner = 'drds.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'drds.aliyuncs.com',
    cn-shenzhen-inner = 'drds.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'drds.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'drds.aliyuncs.com',
    cn-wuhan = 'drds.aliyuncs.com',
    cn-yushanfang = 'drds.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'drds.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'drds.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'drds.aliyuncs.com',
    eu-central-1 = 'drds.ap-southeast-1.aliyuncs.com',
    eu-west-1 = 'drds.ap-southeast-1.aliyuncs.com',
    eu-west-1-oxs = 'drds.ap-southeast-1.aliyuncs.com',
    me-east-1 = 'drds.ap-southeast-1.aliyuncs.com',
    rus-west-1-pop = 'drds.ap-southeast-1.aliyuncs.com',
    us-west-1 = 'drds.ap-southeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('drds', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateDrdsAccountRequest {
  dbName?: string(name='DbName', example='testdb'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.', example='drdsusrzimk2****'),
  password?: string(name='Password', example='Test!123'),
  userName?: string(name='UserName', description='This parameter is required.', example='testaccount'),
}

model CreateDrdsAccountResponseBody = {
  requestId?: string(name='RequestId', example='890BB376-5746-4145-A088-4E610EF3WERT'),
  success?: boolean(name='Success', example='true'),
}

model CreateDrdsAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDrdsAccountResponseBody(name='body'),
}

/**
 * @param request CreateDrdsAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDrdsAccountResponse
 */
async function createDrdsAccountWithOptions(request: CreateDrdsAccountRequest, runtime: Util.RuntimeOptions): CreateDrdsAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDrdsAccount',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateDrdsAccountRequest
 * @return CreateDrdsAccountResponse
 */
async function createDrdsAccount(request: CreateDrdsAccountRequest): CreateDrdsAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDrdsAccountWithOptions(request, runtime);
}

model CreateDrdsDBRequest {
  dbName?: string(name='DbName', description='This parameter is required.', example='test123'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.', example='drdssen12****'),
  encode?: string(name='Encode', description='This parameter is required.', example='utf8'),
  password?: string(name='Password', description='This parameter is required.', example='*********'),
  rdsInstances?: string(name='RdsInstances', description='This parameter is required.', example='[“rdsId1”, “rdsId2”]'),
}

model CreateDrdsDBResponseBody = {
  requestId?: string(name='RequestId', example='8734773E-7B21-4A22-9106-CBD245F8TG57'),
  success?: boolean(name='Success', example='true'),
}

model CreateDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDrdsDBResponseBody(name='body'),
}

/**
 * @param request CreateDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDrdsDBResponse
 */
async function createDrdsDBWithOptions(request: CreateDrdsDBRequest, runtime: Util.RuntimeOptions): CreateDrdsDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.encode)) {
    query['Encode'] = request.encode;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.rdsInstances)) {
    query['RdsInstances'] = request.rdsInstances;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDrdsDB',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateDrdsDBRequest
 * @return CreateDrdsDBResponse
 */
async function createDrdsDB(request: CreateDrdsDBRequest): CreateDrdsDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDrdsDBWithOptions(request, runtime);
}

model CreateDrdsInstanceRequest {
  clientToken?: string(name='ClientToken', example='DEWCEWQA'),
  description?: string(name='Description', example='This is a test instance'),
  duration?: int32(name='Duration', example='5'),
  instanceSeries?: string(name='InstanceSeries', example='drds.sn2.4c16g'),
  isAutoRenew?: boolean(name='IsAutoRenew', example='true'),
  isHa?: boolean(name='IsHa', example='false'),
  payType?: string(name='PayType', description='This parameter is required.', example='drdsPre'),
  pricingCycle?: string(name='PricingCycle', example='month'),
  quantity?: int32(name='Quantity', description='This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  specification?: string(name='Specification', description='This parameter is required.', example='drds.sn2.4c8g.8C16G'),
  type?: string(name='Type', description='This parameter is required.', example='PRIVATE'),
  vpcId?: string(name='VpcId', example='vpc-en23cxsel1'),
  vswitchId?: string(name='VswitchId', example='vsw-ewk32dsk'),
  zoneId?: string(name='ZoneId', description='This parameter is required.', example='cn-hangzhou-e'),
}

model CreateDrdsInstanceResponseBody = {
  data?: {
    drdsInstanceIdList?: {
      drdsInstanceId?: [ string ](name='DrdsInstanceId')
    }(name='DrdsInstanceIdList'),
    orderId?: long(name='OrderId', example='2334632414'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='FF13E47D-4E38-4A5A-BA68-32A554RTY67H'),
  success?: boolean(name='Success', example='true'),
}

model CreateDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDrdsInstanceResponseBody(name='body'),
}

/**
 * @param request CreateDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDrdsInstanceResponse
 */
async function createDrdsInstanceWithOptions(request: CreateDrdsInstanceRequest, runtime: Util.RuntimeOptions): CreateDrdsInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.instanceSeries)) {
    query['InstanceSeries'] = request.instanceSeries;
  }
  if (!Util.isUnset(request.isAutoRenew)) {
    query['IsAutoRenew'] = request.isAutoRenew;
  }
  if (!Util.isUnset(request.isHa)) {
    query['IsHa'] = request.isHa;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.quantity)) {
    query['Quantity'] = request.quantity;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.specification)) {
    query['Specification'] = request.specification;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.vswitchId)) {
    query['VswitchId'] = request.vswitchId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDrdsInstance',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateDrdsInstanceRequest
 * @return CreateDrdsInstanceResponse
 */
async function createDrdsInstance(request: CreateDrdsInstanceRequest): CreateDrdsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDrdsInstanceWithOptions(request, runtime);
}

model CreateReadOnlyAccountRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  password?: string(name='password', description='This parameter is required.'),
}

model CreateReadOnlyAccountResponseBody = {
  data?: {
    accountName?: string(name='AccountName'),
    dbName?: string(name='DbName'),
    drdsInstanceId?: string(name='DrdsInstanceId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateReadOnlyAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateReadOnlyAccountResponseBody(name='body'),
}

/**
 * @param request CreateReadOnlyAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateReadOnlyAccountResponse
 */
async function createReadOnlyAccountWithOptions(request: CreateReadOnlyAccountRequest, runtime: Util.RuntimeOptions): CreateReadOnlyAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.password)) {
    query['password'] = request.password;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateReadOnlyAccount',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateReadOnlyAccountRequest
 * @return CreateReadOnlyAccountResponse
 */
async function createReadOnlyAccount(request: CreateReadOnlyAccountRequest): CreateReadOnlyAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createReadOnlyAccountWithOptions(request, runtime);
}

model DeleteDrdsDBRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DeleteDrdsDBResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDrdsDBResponseBody(name='body'),
}

/**
 * @param request DeleteDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDrdsDBResponse
 */
async function deleteDrdsDBWithOptions(request: DeleteDrdsDBRequest, runtime: Util.RuntimeOptions): DeleteDrdsDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDrdsDB',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteDrdsDBRequest
 * @return DeleteDrdsDBResponse
 */
async function deleteDrdsDB(request: DeleteDrdsDBRequest): DeleteDrdsDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDrdsDBWithOptions(request, runtime);
}

model DeleteFailedDrdsDBRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DeleteFailedDrdsDBResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteFailedDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFailedDrdsDBResponseBody(name='body'),
}

/**
 * @param request DeleteFailedDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFailedDrdsDBResponse
 */
async function deleteFailedDrdsDBWithOptions(request: DeleteFailedDrdsDBRequest, runtime: Util.RuntimeOptions): DeleteFailedDrdsDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFailedDrdsDB',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteFailedDrdsDBRequest
 * @return DeleteFailedDrdsDBResponse
 */
async function deleteFailedDrdsDB(request: DeleteFailedDrdsDBRequest): DeleteFailedDrdsDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFailedDrdsDBWithOptions(request, runtime);
}

model DescribeCreateDrdsInstanceStatusRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeCreateDrdsInstanceStatusResponseBody = {
  data?: {
    status?: string(name='Status'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeCreateDrdsInstanceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCreateDrdsInstanceStatusResponseBody(name='body'),
}

/**
 * @param request DescribeCreateDrdsInstanceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCreateDrdsInstanceStatusResponse
 */
async function describeCreateDrdsInstanceStatusWithOptions(request: DescribeCreateDrdsInstanceStatusRequest, runtime: Util.RuntimeOptions): DescribeCreateDrdsInstanceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCreateDrdsInstanceStatus',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeCreateDrdsInstanceStatusRequest
 * @return DescribeCreateDrdsInstanceStatusResponse
 */
async function describeCreateDrdsInstanceStatus(request: DescribeCreateDrdsInstanceStatusRequest): DescribeCreateDrdsInstanceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCreateDrdsInstanceStatusWithOptions(request, runtime);
}

model DescribeDrdsDBRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeDrdsDBResponseBody = {
  data?: {
    createTime?: string(name='CreateTime'),
    dbName?: string(name='DbName'),
    mode?: string(name='Mode'),
    msg?: string(name='Msg'),
    status?: int32(name='Status'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBResponse
 */
async function describeDrdsDBWithOptions(request: DescribeDrdsDBRequest, runtime: Util.RuntimeOptions): DescribeDrdsDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsDB',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsDBRequest
 * @return DescribeDrdsDBResponse
 */
async function describeDrdsDB(request: DescribeDrdsDBRequest): DescribeDrdsDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsDBWithOptions(request, runtime);
}

model DescribeDrdsDBIpWhiteListRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  groupName?: string(name='GroupName'),
}

model DescribeDrdsDBIpWhiteListResponseBody = {
  data?: {
    ipWhiteList?: {
      ip?: [ string ](name='Ip')
    }(name='IpWhiteList'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsDBIpWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBIpWhiteListResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBIpWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBIpWhiteListResponse
 */
async function describeDrdsDBIpWhiteListWithOptions(request: DescribeDrdsDBIpWhiteListRequest, runtime: Util.RuntimeOptions): DescribeDrdsDBIpWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsDBIpWhiteList',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsDBIpWhiteListRequest
 * @return DescribeDrdsDBIpWhiteListResponse
 */
async function describeDrdsDBIpWhiteList(request: DescribeDrdsDBIpWhiteListRequest): DescribeDrdsDBIpWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsDBIpWhiteListWithOptions(request, runtime);
}

model DescribeDrdsDBsRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeDrdsDBsResponseBody = {
  data?: {
    db?: [ 
    {
      createTime?: string(name='CreateTime'),
      dbName?: string(name='DbName'),
      mode?: string(name='Mode'),
      msg?: string(name='Msg'),
      status?: int32(name='Status'),
    }
  ](name='Db')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsDBsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsDBsResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsDBsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsDBsResponse
 */
async function describeDrdsDBsWithOptions(request: DescribeDrdsDBsRequest, runtime: Util.RuntimeOptions): DescribeDrdsDBsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsDBs',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsDBsRequest
 * @return DescribeDrdsDBsResponse
 */
async function describeDrdsDBs(request: DescribeDrdsDBsRequest): DescribeDrdsDBsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsDBsWithOptions(request, runtime);
}

model DescribeDrdsInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.', example='drdshbga33pe****'),
}

model DescribeDrdsInstanceResponseBody = {
  data?: {
    createTime?: long(name='CreateTime', example='1568620311000'),
    description?: string(name='Description', example='111111'),
    drdsInstanceId?: string(name='DrdsInstanceId', example='drdshbga33pe****'),
    networkType?: string(name='NetworkType', example='VPC'),
    regionId?: string(name='RegionId', example='China (Hangzhou)'),
    specification?: string(name='Specification', example='drds.sn1.4c8g.8C16G'),
    status?: string(name='Status', example='0'),
    type?: string(name='Type', example='0'),
    version?: long(name='Version', example='0'),
    vips?: {
      vip?: [ 
      {
        IP?: string(name='IP', example='1.2.XX.XX'),
        port?: string(name='Port', example='3306'),
        type?: string(name='Type', example='VPC'),
        vpcId?: string(name='VpcId', example='vpc-en23cx****'),
        vswitchId?: string(name='VswitchId', example='vsw-ewk3****'),
      }
    ](name='Vip')
    }(name='Vips'),
    vpcCloudInstanceId?: string(name='VpcCloudInstanceId', example='oogbx6c2atj****'),
    zoneId?: string(name='ZoneId', example='cn-hangzhou-e'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='B4F76641-BA45-4320-BE7C-9C62CFDAC9B2'),
  success?: boolean(name='Success', example='true'),
}

model DescribeDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceResponse
 */
async function describeDrdsInstanceWithOptions(request: DescribeDrdsInstanceRequest, runtime: Util.RuntimeOptions): DescribeDrdsInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsInstance',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsInstanceRequest
 * @return DescribeDrdsInstanceResponse
 */
async function describeDrdsInstance(request: DescribeDrdsInstanceRequest): DescribeDrdsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsInstanceWithOptions(request, runtime);
}

model DescribeDrdsInstanceDbMonitorRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  endTime?: long(name='EndTime', description='This parameter is required.'),
  key?: string(name='Key', description='This parameter is required.'),
  startTime?: long(name='StartTime', description='This parameter is required.'),
}

model DescribeDrdsInstanceDbMonitorResponseBody = {
  data?: {
    partialPerformanceData?: [ 
    {
      key?: string(name='Key'),
      unit?: string(name='Unit'),
      values?: {
        performanceValue?: [ 
        {
          date?: long(name='Date'),
          value?: string(name='Value'),
        }
      ](name='PerformanceValue')
      }(name='Values'),
    }
  ](name='PartialPerformanceData')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsInstanceDbMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceDbMonitorResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceDbMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceDbMonitorResponse
 */
async function describeDrdsInstanceDbMonitorWithOptions(request: DescribeDrdsInstanceDbMonitorRequest, runtime: Util.RuntimeOptions): DescribeDrdsInstanceDbMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsInstanceDbMonitor',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsInstanceDbMonitorRequest
 * @return DescribeDrdsInstanceDbMonitorResponse
 */
async function describeDrdsInstanceDbMonitor(request: DescribeDrdsInstanceDbMonitorRequest): DescribeDrdsInstanceDbMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsInstanceDbMonitorWithOptions(request, runtime);
}

model DescribeDrdsInstanceMonitorRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  endTime?: long(name='EndTime', description='This parameter is required.'),
  key?: string(name='Key', description='This parameter is required.'),
  periodMultiple?: int32(name='PeriodMultiple'),
  startTime?: long(name='StartTime', description='This parameter is required.'),
}

model DescribeDrdsInstanceMonitorResponseBody = {
  data?: {
    partialPerformanceData?: [ 
    {
      key?: string(name='Key'),
      unit?: string(name='Unit'),
      values?: {
        performanceValue?: [ 
        {
          date?: long(name='Date'),
          value?: string(name='Value'),
        }
      ](name='PerformanceValue')
      }(name='Values'),
    }
  ](name='PartialPerformanceData')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsInstanceMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceMonitorResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceMonitorResponse
 */
async function describeDrdsInstanceMonitorWithOptions(request: DescribeDrdsInstanceMonitorRequest, runtime: Util.RuntimeOptions): DescribeDrdsInstanceMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.periodMultiple)) {
    query['PeriodMultiple'] = request.periodMultiple;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsInstanceMonitor',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsInstanceMonitorRequest
 * @return DescribeDrdsInstanceMonitorResponse
 */
async function describeDrdsInstanceMonitor(request: DescribeDrdsInstanceMonitorRequest): DescribeDrdsInstanceMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsInstanceMonitorWithOptions(request, runtime);
}

model DescribeDrdsInstanceNetInfoForInnerRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeDrdsInstanceNetInfoForInnerResponseBody = {
  drdsInstanceId?: string(name='DrdsInstanceId'),
  netInfos?: {
    netInfo?: [ 
    {
      IP?: string(name='IP'),
      isForVpc?: boolean(name='IsForVpc'),
      port?: string(name='Port'),
      type?: string(name='Type'),
    }
  ](name='NetInfo')
  }(name='NetInfos'),
  networkType?: string(name='NetworkType'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsInstanceNetInfoForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstanceNetInfoForInnerResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstanceNetInfoForInnerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstanceNetInfoForInnerResponse
 */
async function describeDrdsInstanceNetInfoForInnerWithOptions(request: DescribeDrdsInstanceNetInfoForInnerRequest, runtime: Util.RuntimeOptions): DescribeDrdsInstanceNetInfoForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsInstanceNetInfoForInner',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsInstanceNetInfoForInnerRequest
 * @return DescribeDrdsInstanceNetInfoForInnerResponse
 */
async function describeDrdsInstanceNetInfoForInner(request: DescribeDrdsInstanceNetInfoForInnerRequest): DescribeDrdsInstanceNetInfoForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsInstanceNetInfoForInnerWithOptions(request, runtime);
}

model DescribeDrdsInstancesRequest {
  regionId?: string(name='RegionId', description='This parameter is required.'),
  tags?: string(name='Tags'),
  type?: string(name='Type'),
}

model DescribeDrdsInstancesResponseBody = {
  data?: {
    instance?: [ 
    {
      createTime?: long(name='CreateTime'),
      description?: string(name='Description'),
      drdsInstanceId?: string(name='DrdsInstanceId'),
      instRole?: string(name='InstRole'),
      masterInstId?: string(name='MasterInstId'),
      networkType?: string(name='NetworkType'),
      regionId?: string(name='RegionId'),
      slaveInstId?: {
        instId?: [ string ](name='instId')
      }(name='SlaveInstId'),
      status?: string(name='Status'),
      type?: string(name='Type'),
      version?: long(name='Version'),
      vips?: {
        vip?: [ 
        {
          IP?: string(name='IP'),
          port?: string(name='Port'),
          type?: string(name='Type'),
          vpcId?: string(name='VpcId'),
          vswitchId?: string(name='VswitchId'),
        }
      ](name='Vip')
      }(name='Vips'),
      vpcCloudInstanceId?: string(name='VpcCloudInstanceId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='Instance')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDrdsInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDrdsInstancesResponseBody(name='body'),
}

/**
 * @param request DescribeDrdsInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDrdsInstancesResponse
 */
async function describeDrdsInstancesWithOptions(request: DescribeDrdsInstancesRequest, runtime: Util.RuntimeOptions): DescribeDrdsInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDrdsInstances',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDrdsInstancesRequest
 * @return DescribeDrdsInstancesResponse
 */
async function describeDrdsInstances(request: DescribeDrdsInstancesRequest): DescribeDrdsInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDrdsInstancesWithOptions(request, runtime);
}

model DescribeRdsListRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model DescribeRdsListResponseBody = {
  data?: {
    rdsInstance?: [ 
    {
      connectUrl?: string(name='ConnectUrl'),
      dbType?: string(name='DbType'),
      instanceId?: int32(name='InstanceId'),
      instanceName?: string(name='InstanceName'),
      instanceStatus?: string(name='InstanceStatus'),
      port?: int32(name='Port'),
      readOnlyChildren?: {
        child?: [ 
        {
          connectUrl?: string(name='ConnectUrl'),
          dbType?: string(name='DbType'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          instanceStatus?: string(name='InstanceStatus'),
          readWeight?: int32(name='ReadWeight'),
          port?: int32(name='port'),
        }
      ](name='Child')
      }(name='ReadOnlyChildren'),
      readWeight?: int32(name='ReadWeight'),
    }
  ](name='RdsInstance')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeRdsListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRdsListResponseBody(name='body'),
}

/**
 * @param request DescribeRdsListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRdsListResponse
 */
async function describeRdsListWithOptions(request: DescribeRdsListRequest, runtime: Util.RuntimeOptions): DescribeRdsListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRdsList',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeRdsListRequest
 * @return DescribeRdsListResponse
 */
async function describeRdsList(request: DescribeRdsListRequest): DescribeRdsListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRdsListWithOptions(request, runtime);
}

model DescribeReadOnlyAccountRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeReadOnlyAccountResponseBody = {
  data?: {
    accountName?: string(name='AccountName'),
    dbName?: string(name='DbName'),
    drdsInstanceId?: string(name='DrdsInstanceId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeReadOnlyAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeReadOnlyAccountResponseBody(name='body'),
}

/**
 * @param request DescribeReadOnlyAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeReadOnlyAccountResponse
 */
async function describeReadOnlyAccountWithOptions(request: DescribeReadOnlyAccountRequest, runtime: Util.RuntimeOptions): DescribeReadOnlyAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeReadOnlyAccount',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeReadOnlyAccountRequest
 * @return DescribeReadOnlyAccountResponse
 */
async function describeReadOnlyAccount(request: DescribeReadOnlyAccountRequest): DescribeReadOnlyAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeReadOnlyAccountWithOptions(request, runtime);
}

model DescribeRegionsResponseBody = {
  drdsRegions?: {
    drdsRegion?: [ 
    {
      instanceSeriesList?: {
        instanceSeries?: [ 
        {
          seriesId?: string(name='SeriesId'),
          seriesName?: string(name='SeriesName'),
          specList?: {
            spec?: [ 
            {
              specId?: string(name='SpecId'),
              specName?: string(name='SpecName'),
            }
          ](name='Spec')
          }(name='SpecList'),
        }
      ](name='InstanceSeries')
      }(name='InstanceSeriesList'),
      regionId?: string(name='RegionId'),
      regionName?: string(name='RegionName'),
      zoneId?: string(name='ZoneId'),
      zoneName?: string(name='ZoneName'),
    }
  ](name='DrdsRegion')
  }(name='DrdsRegions'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return DescribeRegionsResponse
 */
async function describeRegions(): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(runtime);
}

model DescribeShardDBsRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model DescribeShardDBsResponseBody = {
  data?: {
    dbIntancePair?: [ 
    {
      groupName?: string(name='GroupName'),
      instanceName?: string(name='InstanceName'),
      subDbName?: string(name='SubDbName'),
    }
  ](name='DbIntancePair')
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeShardDBsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeShardDBsResponseBody(name='body'),
}

/**
 * @param request DescribeShardDBsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeShardDBsResponse
 */
async function describeShardDBsWithOptions(request: DescribeShardDBsRequest, runtime: Util.RuntimeOptions): DescribeShardDBsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeShardDBs',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeShardDBsRequest
 * @return DescribeShardDBsResponse
 */
async function describeShardDBs(request: DescribeShardDBsRequest): DescribeShardDBsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeShardDBsWithOptions(request, runtime);
}

model DescribeShardDbConnectionInfoRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  subDbName?: string(name='SubDbName', description='This parameter is required.'),
}

model DescribeShardDbConnectionInfoResponseBody = {
  connectionInfo?: {
    instanceName?: string(name='InstanceName'),
    instanceUrl?: string(name='InstanceUrl'),
    blockingTimeout?: int32(name='blockingTimeout'),
    connectionProperties?: string(name='connectionProperties'),
    dbStatus?: string(name='dbStatus'),
    dbType?: string(name='dbType'),
    idleTimeOut?: int32(name='idleTimeOut'),
    maxPoolSize?: int32(name='maxPoolSize'),
    minPoolSize?: int32(name='minPoolSize'),
    preparedStatementCacheSize?: int32(name='preparedStatementCacheSize'),
    subDbName?: string(name='subDbName'),
    userName?: string(name='userName'),
  }(name='ConnectionInfo'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeShardDbConnectionInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeShardDbConnectionInfoResponseBody(name='body'),
}

/**
 * @param request DescribeShardDbConnectionInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeShardDbConnectionInfoResponse
 */
async function describeShardDbConnectionInfoWithOptions(request: DescribeShardDbConnectionInfoRequest, runtime: Util.RuntimeOptions): DescribeShardDbConnectionInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.subDbName)) {
    query['SubDbName'] = request.subDbName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeShardDbConnectionInfo',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeShardDbConnectionInfoRequest
 * @return DescribeShardDbConnectionInfoResponse
 */
async function describeShardDbConnectionInfo(request: DescribeShardDbConnectionInfoRequest): DescribeShardDbConnectionInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeShardDbConnectionInfoWithOptions(request, runtime);
}

model EnableInstanceRequest {
  backupId?: string(name='BackupId'),
  clientToken?: string(name='ClientToken'),
  dbInstanceClass?: string(name='DbInstanceClass'),
  drdsInstanceId?: string(name='DrdsInstanceId'),
  engineVersion?: string(name='EngineVersion'),
  restoreTime?: string(name='RestoreTime'),
  sourceDbInstId?: string(name='SourceDbInstId', description='This parameter is required.'),
  switchId?: string(name='SwitchId'),
  vpcId?: string(name='VpcId'),
  zoneId?: string(name='ZoneId'),
}

model EnableInstanceResponseBody = {
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
  success?: boolean(name='Success'),
}

model EnableInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableInstanceResponseBody(name='body'),
}

/**
 * @param request EnableInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableInstanceResponse
 */
async function enableInstanceWithOptions(request: EnableInstanceRequest, runtime: Util.RuntimeOptions): EnableInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dbInstanceClass)) {
    query['DbInstanceClass'] = request.dbInstanceClass;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.sourceDbInstId)) {
    query['SourceDbInstId'] = request.sourceDbInstId;
  }
  if (!Util.isUnset(request.switchId)) {
    query['SwitchId'] = request.switchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableInstance',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EnableInstanceRequest
 * @return EnableInstanceResponse
 */
async function enableInstance(request: EnableInstanceRequest): EnableInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableInstanceWithOptions(request, runtime);
}

model ModifyDrdsDBPasswdRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  newPasswd?: string(name='NewPasswd', description='This parameter is required.'),
}

model ModifyDrdsDBPasswdResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyDrdsDBPasswdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDrdsDBPasswdResponseBody(name='body'),
}

/**
 * @param request ModifyDrdsDBPasswdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDrdsDBPasswdResponse
 */
async function modifyDrdsDBPasswdWithOptions(request: ModifyDrdsDBPasswdRequest, runtime: Util.RuntimeOptions): ModifyDrdsDBPasswdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.newPasswd)) {
    query['NewPasswd'] = request.newPasswd;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDrdsDBPasswd',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyDrdsDBPasswdRequest
 * @return ModifyDrdsDBPasswdResponse
 */
async function modifyDrdsDBPasswd(request: ModifyDrdsDBPasswdRequest): ModifyDrdsDBPasswdResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDrdsDBPasswdWithOptions(request, runtime);
}

model ModifyDrdsInstanceDescriptionRequest {
  description?: string(name='Description', description='This parameter is required.', example='This is a test instance.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.', example='drdshbga33pe****'),
}

model ModifyDrdsInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId', example='B4F76641-BA45-4320-BE7C-9C62CFDAR56T'),
  success?: boolean(name='Success', example='true'),
}

model ModifyDrdsInstanceDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDrdsInstanceDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyDrdsInstanceDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDrdsInstanceDescriptionResponse
 */
async function modifyDrdsInstanceDescriptionWithOptions(request: ModifyDrdsInstanceDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDrdsInstanceDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDrdsInstanceDescription',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyDrdsInstanceDescriptionRequest
 * @return ModifyDrdsInstanceDescriptionResponse
 */
async function modifyDrdsInstanceDescription(request: ModifyDrdsInstanceDescriptionRequest): ModifyDrdsInstanceDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDrdsInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDrdsIpWhiteListRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  groupAttribute?: string(name='GroupAttribute'),
  groupName?: string(name='GroupName'),
  ipWhiteList?: string(name='IpWhiteList', description='This parameter is required.'),
  mode?: boolean(name='Mode'),
}

model ModifyDrdsIpWhiteListResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyDrdsIpWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDrdsIpWhiteListResponseBody(name='body'),
}

/**
 * @param request ModifyDrdsIpWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDrdsIpWhiteListResponse
 */
async function modifyDrdsIpWhiteListWithOptions(request: ModifyDrdsIpWhiteListRequest, runtime: Util.RuntimeOptions): ModifyDrdsIpWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.groupAttribute)) {
    query['GroupAttribute'] = request.groupAttribute;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ipWhiteList)) {
    query['IpWhiteList'] = request.ipWhiteList;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDrdsIpWhiteList',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyDrdsIpWhiteListRequest
 * @return ModifyDrdsIpWhiteListResponse
 */
async function modifyDrdsIpWhiteList(request: ModifyDrdsIpWhiteListRequest): ModifyDrdsIpWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDrdsIpWhiteListWithOptions(request, runtime);
}

model ModifyFullTableScanRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  fullTableScan?: boolean(name='FullTableScan', description='This parameter is required.'),
  tableNames?: string(name='TableNames', description='This parameter is required.'),
}

model ModifyFullTableScanResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyFullTableScanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyFullTableScanResponseBody(name='body'),
}

/**
 * @param request ModifyFullTableScanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyFullTableScanResponse
 */
async function modifyFullTableScanWithOptions(request: ModifyFullTableScanRequest, runtime: Util.RuntimeOptions): ModifyFullTableScanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.fullTableScan)) {
    query['FullTableScan'] = request.fullTableScan;
  }
  if (!Util.isUnset(request.tableNames)) {
    query['TableNames'] = request.tableNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyFullTableScan',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyFullTableScanRequest
 * @return ModifyFullTableScanResponse
 */
async function modifyFullTableScan(request: ModifyFullTableScanRequest): ModifyFullTableScanResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyFullTableScanWithOptions(request, runtime);
}

model ModifyRdsReadWeightRequest {
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  instanceNames?: string(name='InstanceNames', description='This parameter is required.'),
  weights?: string(name='Weights', description='This parameter is required.'),
}

model ModifyRdsReadWeightResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyRdsReadWeightResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyRdsReadWeightResponseBody(name='body'),
}

/**
 * @param request ModifyRdsReadWeightRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyRdsReadWeightResponse
 */
async function modifyRdsReadWeightWithOptions(request: ModifyRdsReadWeightRequest, runtime: Util.RuntimeOptions): ModifyRdsReadWeightResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.instanceNames)) {
    query['InstanceNames'] = request.instanceNames;
  }
  if (!Util.isUnset(request.weights)) {
    query['Weights'] = request.weights;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyRdsReadWeight',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyRdsReadWeightRequest
 * @return ModifyRdsReadWeightResponse
 */
async function modifyRdsReadWeight(request: ModifyRdsReadWeightRequest): ModifyRdsReadWeightResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyRdsReadWeightWithOptions(request, runtime);
}

model ModifyReadOnlyAccountPasswordRequest {
  accountName?: string(name='AccountName', description='This parameter is required.'),
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
  newPasswd?: string(name='NewPasswd', description='This parameter is required.'),
  originPassword?: string(name='OriginPassword', description='This parameter is required.'),
}

model ModifyReadOnlyAccountPasswordResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyReadOnlyAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyReadOnlyAccountPasswordResponseBody(name='body'),
}

/**
 * @param request ModifyReadOnlyAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyReadOnlyAccountPasswordResponse
 */
async function modifyReadOnlyAccountPasswordWithOptions(request: ModifyReadOnlyAccountPasswordRequest, runtime: Util.RuntimeOptions): ModifyReadOnlyAccountPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  if (!Util.isUnset(request.newPasswd)) {
    query['NewPasswd'] = request.newPasswd;
  }
  if (!Util.isUnset(request.originPassword)) {
    query['OriginPassword'] = request.originPassword;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyReadOnlyAccountPassword',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyReadOnlyAccountPasswordRequest
 * @return ModifyReadOnlyAccountPasswordResponse
 */
async function modifyReadOnlyAccountPassword(request: ModifyReadOnlyAccountPasswordRequest): ModifyReadOnlyAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyReadOnlyAccountPasswordWithOptions(request, runtime);
}

model QueryInstanceInfoByConnRequest {
  host?: string(name='Host', description='This parameter is required.'),
  port?: int32(name='Port', description='This parameter is required.'),
  userName?: string(name='UserName', description='This parameter is required.'),
}

model QueryInstanceInfoByConnResponseBody = {
  data?: {
    createTime?: long(name='CreateTime'),
    description?: string(name='Description'),
    drdsInstanceId?: string(name='DrdsInstanceId'),
    networkType?: string(name='NetworkType'),
    regionId?: string(name='RegionId'),
    specTypeId?: string(name='SpecTypeId'),
    specTypeName?: string(name='SpecTypeName'),
    specification?: string(name='Specification'),
    status?: string(name='Status'),
    type?: string(name='Type'),
    version?: long(name='Version'),
    vips?: {
      vip?: [ 
      {
        IP?: string(name='IP'),
        port?: string(name='Port'),
        type?: string(name='Type'),
        vpcId?: string(name='VpcId'),
        vswitchId?: string(name='VswitchId'),
      }
    ](name='Vip')
    }(name='Vips'),
    vpcCloudInstanceId?: string(name='VpcCloudInstanceId'),
    zoneId?: string(name='ZoneId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryInstanceInfoByConnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryInstanceInfoByConnResponseBody(name='body'),
}

/**
 * @param request QueryInstanceInfoByConnRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryInstanceInfoByConnResponse
 */
async function queryInstanceInfoByConnWithOptions(request: QueryInstanceInfoByConnRequest, runtime: Util.RuntimeOptions): QueryInstanceInfoByConnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.host)) {
    query['Host'] = request.host;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryInstanceInfoByConn',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryInstanceInfoByConnRequest
 * @return QueryInstanceInfoByConnResponse
 */
async function queryInstanceInfoByConn(request: QueryInstanceInfoByConnRequest): QueryInstanceInfoByConnResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryInstanceInfoByConnWithOptions(request, runtime);
}

model RemoveDrdsInstanceRequest {
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model RemoveDrdsInstanceResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RemoveDrdsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveDrdsInstanceResponseBody(name='body'),
}

/**
 * @param request RemoveDrdsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveDrdsInstanceResponse
 */
async function removeDrdsInstanceWithOptions(request: RemoveDrdsInstanceRequest, runtime: Util.RuntimeOptions): RemoveDrdsInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveDrdsInstance',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RemoveDrdsInstanceRequest
 * @return RemoveDrdsInstanceResponse
 */
async function removeDrdsInstance(request: RemoveDrdsInstanceRequest): RemoveDrdsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeDrdsInstanceWithOptions(request, runtime);
}

model RemoveReadOnlyAccountRequest {
  accountName?: string(name='AccountName', description='This parameter is required.'),
  dbName?: string(name='DbName', description='This parameter is required.'),
  drdsInstanceId?: string(name='DrdsInstanceId', description='This parameter is required.'),
}

model RemoveReadOnlyAccountResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RemoveReadOnlyAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveReadOnlyAccountResponseBody(name='body'),
}

/**
 * @param request RemoveReadOnlyAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveReadOnlyAccountResponse
 */
async function removeReadOnlyAccountWithOptions(request: RemoveReadOnlyAccountRequest, runtime: Util.RuntimeOptions): RemoveReadOnlyAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.drdsInstanceId)) {
    query['DrdsInstanceId'] = request.drdsInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveReadOnlyAccount',
    version = '2017-10-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RemoveReadOnlyAccountRequest
 * @return RemoveReadOnlyAccountResponse
 */
async function removeReadOnlyAccount(request: RemoveReadOnlyAccountRequest): RemoveReadOnlyAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeReadOnlyAccountWithOptions(request, runtime);
}

